package cn.wusifx.zabbix.request.builder.task;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/task/create
 */
public class TaskCreateRequestBuilder extends CreateRequestBuilder {
    private Integer type;
    private List<String> itemIds;
    public TaskCreateRequestBuilder(String auth) {
        super("task.create", auth);
    }

    public TaskCreateRequestBuilder(Long id, String auth) {
        super("task.create", id, auth);
    }

    public Integer getType() {
        return type;
    }

    public TaskCreateRequestBuilder setType(Integer type) {
        this.type = type;
        return this;
    }

    public List<String> getItemIds() {
        return itemIds;
    }

    public TaskCreateRequestBuilder setItemIds(List<String> itemIds) {
        this.itemIds = itemIds;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("type",type);
        baseRequest.getParams().put("itemids",itemIds);
        return baseRequest;
    }
}
